Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UUID to JSON output #1342

Merged
merged 11 commits into from
Oct 2, 2024

Conversation

adhilto
Copy link
Collaborator

@adhilto adhilto commented Sep 27, 2024

🗣 Description

Add UUID to the JSON output (both raw provider output and ScubaResults.json).

💭 Motivation and context

Closes #1336.

🧪 Testing

I performed the following tests:

  1. Invoke-Scuba. Worked as expected.
  2. Invoke-Scuba -KeepIndividualJson. Worked as expected.
  3. Invoke-ScubaCached -ExportProvider $false with input generated without the KeepIndividualJson flag. Worked as expected.
  4. Invoke-ScubaCached -ExportProvider $false with input generated with the KeepIndividualJson flag. Worked as expected. (assuming you manually fix Bug with Invoke-SCuBACached if no provider json #1329 as Fix functional testing and cached output errors #1334 hasn't been merged yet).
  5. Invoke-ScubaCached -KeepIndividualJson -ExportProvider $false with input generated without the KeepIndividualJson flag. Worked as expected.
  6. Invoke-ScubaCached -KeepIndividualJson -ExportProvider $false with input generated with the KeepIndividualJson flag.
  7. Invoke-ScubaCached -ExportProvider $false with input generated without the KeepIndividualJson flag and without the "report_uuid" field (to ensure backwards compatibility with output created before this PR). Worked as expected.
  8. Invoke-ScubaCached -ExportProvider $false with input generated with the KeepIndividualJson flag and without the "report_uuid" field. Worked as expected.
  9. Invoke-SCuBACached. Worked as expected.
  10. Invoke-SCuBACached -KeepIndividualJson. Worked as expected.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • PR targets the correct parent branch (e.g., main or release-name) for merge.
  • Changes are limited to a single goal - eschew scope creep!
  • Changes are sized such that they do not touch excessive number of files.
  • All future TODOs are captured in issues, which are referenced in code comments.
  • These code changes follow the ScubaGear content style guide.
  • Related issues these changes resolve are linked preferably via closing keywords.
  • All relevant type-of-change labels added.
  • All relevant project fields are set.
  • All relevant repo and/or project documentation updated to reflect these changes.
  • Unit tests added/updated to cover PowerShell and Rego changes.
  • Functional tests added/updated to cover PowerShell and Rego changes.
  • All relevant functional tests passed.
  • All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.

✅ Pre-merge checklist

  • PR passed smoke test check.

  • Feature branch has been rebased against changes from parent branch, as needed

    Use Rebase branch button below or use this reference to rebase from the command line.

  • Resolved all merge conflicts on branch

  • Notified merge coordinator that PR is ready for merge via comment mention

✅ Post-merge checklist

  • Feature branch deleted after merge to clean up repository.
  • Verified that all checks pass on parent branch (e.g., main or release-name) after merge.

@adhilto adhilto added the enhancement This issue or pull request will add new or improve existing functionality label Sep 27, 2024
@adhilto adhilto added this to the Jellyfish milestone Sep 27, 2024
@adhilto adhilto self-assigned this Sep 27, 2024
@adhilto adhilto linked an issue Sep 27, 2024 that may be closed by this pull request
@schrolla schrolla force-pushed the 1336-generate-a-uuid-for-the-scuba-output branch from 7867c61 to e31bd53 Compare September 30, 2024 13:37
Copy link
Collaborator

@schrolla schrolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running through the testing section, all tests worked as expected. However, I did have some thoughts about ordering for the new report_uuid field for readability purposes and a bit more error handling and unit testing around New-Guid.

Would a future TODO be to also add this report UUID somewhere in the HTML report as well so that the two reports (JSON and HTML) could be correlated? Also, so multiple HTML report runs could be disambiguated (other than using the timestamp).

Copy link
Collaborator

@schrolla schrolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed newest updates which addressed previous comments. Ran unit tests which passed and ran several variations of Invoke-Scuba and Invoke-ScubaCached which worked as well. Looks good.

@buidav buidav self-requested a review October 1, 2024 21:06
@adhilto
Copy link
Collaborator Author

adhilto commented Oct 1, 2024

@nanda-katikaneni ready to be merged. The failed smoke tests all appear to be due to the Power Platform issue #1345.

@schrolla
Copy link
Collaborator

schrolla commented Oct 2, 2024

@adhilto Looks like there is a merge conflict preventing a rebase in the branch. May require manual review.

@adhilto adhilto force-pushed the 1336-generate-a-uuid-for-the-scuba-output branch from e1ea8e6 to e87e373 Compare October 2, 2024 16:46
@adhilto
Copy link
Collaborator Author

adhilto commented Oct 2, 2024

@nanda-katikaneni I successfully rebased with main and now all tests are passing. Ready to merge.

@nanda-katikaneni nanda-katikaneni merged commit f7d73ee into main Oct 2, 2024
21 checks passed
@nanda-katikaneni nanda-katikaneni deleted the 1336-generate-a-uuid-for-the-scuba-output branch October 2, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate a UUID for the SCuBA output Bug with Invoke-SCuBACached if no provider json
4 participants